From: Tiejun Chen Date: Wed, 20 May 2015 11:31:08 +0000 (+0200) Subject: pci: make pci_device_detect() return bool_t X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3218 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https://%22%22/%22http:/www.example.com/cgi/%22https:/%22%22?a=commitdiff_plain;h=119ce8154c32202fe30c4474819e64605333f297;p=xen.git pci: make pci_device_detect() return bool_t This function should better return as bool_t and remove that pointless comment. Suggested-by: Jan Beulich Signed-off-by: Tiejun Chen --- diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index 862e20f876..e30be43a58 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -904,10 +904,7 @@ out: return ret; } -/* - * detect pci device, return 0 if it exists, or return 0 - */ -int __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func) +bool_t __init pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func) { u32 vendor; @@ -965,7 +962,7 @@ static int __init _scan_pci_devices(struct pci_seg *pseg, void *arg) { for ( func = 0; func < 8; func++ ) { - if ( pci_device_detect(pseg->nr, bus, dev, func) == 0 ) + if ( !pci_device_detect(pseg->nr, bus, dev, func) ) { if ( !func ) break; diff --git a/xen/drivers/passthrough/vtd/dmar.c b/xen/drivers/passthrough/vtd/dmar.c index 18d7903ec2..2b07be98a2 100644 --- a/xen/drivers/passthrough/vtd/dmar.c +++ b/xen/drivers/passthrough/vtd/dmar.c @@ -524,7 +524,7 @@ acpi_parse_one_drhd(struct acpi_dmar_header *header) d = PCI_SLOT(dmaru->scope.devices[i]); f = PCI_FUNC(dmaru->scope.devices[i]); - if ( pci_device_detect(drhd->segment, b, d, f) == 0 ) + if ( !pci_device_detect(drhd->segment, b, d, f) ) { dprintk(XENLOG_WARNING VTDPREFIX, " Non-existent device (%04x:%02x:%02x.%u) is reported" @@ -636,7 +636,7 @@ acpi_parse_one_rmrr(struct acpi_dmar_header *header) d = PCI_SLOT(rmrru->scope.devices[i]); f = PCI_FUNC(rmrru->scope.devices[i]); - if ( pci_device_detect(rmrr->segment, b, d, f) == 0 ) + if ( !pci_device_detect(rmrr->segment, b, d, f) ) { dprintk(XENLOG_WARNING VTDPREFIX, " Non-existent device (%04x:%02x:%02x.%u) is reported" diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index 4377f3e9cc..3908146bd7 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -93,7 +93,7 @@ struct pci_dev { extern spinlock_t pcidevs_lock; bool_t pci_known_segment(u16 seg); -int pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func); +bool_t pci_device_detect(u16 seg, u8 bus, u8 dev, u8 func); int scan_pci_devices(void); enum pdev_type pdev_type(u16 seg, u8 bus, u8 devfn); int find_upstream_bridge(u16 seg, u8 *bus, u8 *devfn, u8 *secbus);